package ncm;

import com.sun.source.tree.IfTree;

public class MyStringText {
    public static void main(String[] args) {
        String s1 = new String("hello java");
        String s2 = new String("hello java");
        if (s1.equals(s2)){//比较是否相等
        String temp = s1.replace(" ", "").replace("java","word");//替换
            System.out.println(temp);}
        else {
            System.out.println("不相等");
        }
    }
}